import axios from 'axios';

const API_BASE = 'http://localhost:8080/teach';

export const studentApi = {
  // 获取学生列表
  getStudents: (params = {}) => {
    return axios.get(`${API_BASE}/students`, { params });
  },

  // 获取学生详情
  getStudent: (id) => {
    return axios.get(`${API_BASE}/students/${id}`);
  },

  // 创建学生
  createStudent: (studentData) => {
    return axios.post(`${API_BASE}/students`, studentData);
  },

  // 更新学生
  updateStudent: (id, studentData) => {
    return axios.put(`${API_BASE}/students/${id}`, studentData);
  },

  // 删除学生
  deleteStudent: (id) => {
    return axios.delete(`${API_BASE}/students/${id}`);
  }
};